package com.framework.service.yhbservice.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.framework.dao.YHBDao.terminalDao.YhbGoodsBannerDao;
import com.framework.entity.ter.TerGoodsBanner;
import com.framework.service.yhbservice.YhbGoodsBannerService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.List;
@Transactional(rollbackFor = Exception.class)
@Service("yhbGoodsBannerService")
public class YhbGoodsBannerServiceImpl extends ServiceImpl<YhbGoodsBannerDao,TerGoodsBanner> implements YhbGoodsBannerService {

    @Override
    public List<TerGoodsBanner> queryGoodsBannerList(Long goodsId) {
        List<String> listAsc=new ArrayList<>();
        listAsc.add("sort");
        List<TerGoodsBanner> list = baseMapper.selectList(new EntityWrapper<TerGoodsBanner>()
                .eq("goods_id", goodsId)
                .orderAsc(listAsc)
        );
        return list;
    }
}
